// OptionCommand.cpp: implementation of the COptionCommand class.
//
//////////////////////////////////////////////////////////////////////

#include "stdafx.h"
#include "AnsiTerminal.h"
#include "OptionCommand.h"

// 
// #include "TerminalTypeOption.h"
// #include "WindowSizeOption.h"
// #include "LineModeOption.h"
// #include "UnknownOption.h"
// #include "EchoOption.h"
// #include "StatusOption.h"
// #include "TimingMarkOption.h"
// #include "TransmitBinaryOption.h"
// #include "SupressGoAheadOption.h"
// #include "ExoplOption.h"

#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif


//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////

COptionCommand::COptionCommand(ITelnetOptionCollection *pOptionCol)
{
	m_pOption = NULL;
	m_pOptionCol = pOptionCol;
}

COptionCommand::~COptionCommand()
{
}

BOOL COptionCommand::EatChar(char c)
{
	if(m_pOption)
		return FALSE;

	setOption(m_pOptionCol->FindOption(c));
	DealOption();
	
	return TRUE;
}

void COptionCommand::setOption(CTelnetOption *pOption)
{
	ASSERT(!m_pOption);
	m_pOption = pOption;
}

void COptionCommand::DealOption()
{
	// do nothing
}
